package com.TeamJigsaw.DanteTrail.Views;

import java.awt.Dimension;
import javax.swing.*;
import javax.swing.UIManager.*;

import com.TeamJigsaw.DanteTrail.Views.Interfaces.GameViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.HuntingViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.MapViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.PartySetupInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.PartyStatusViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.ProfessionInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.RiverGameInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.RiverViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.ShopViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.SplashInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.TownViewInterface;
import com.TeamJigsaw.DanteTrail.Views.Interfaces.WagonViewInterface;

import java.awt.CardLayout;

public class MainViewFrame extends JFrame{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SplashInterface splash;
	private PartySetupInterface setup;
	private ProfessionInterface profession;
	private ShopViewInterface shop;
	private GameViewInterface game;
	private MapViewInterface map;
	private TownViewInterface town;
	private RiverViewInterface river;
	private WagonViewInterface wagon;
	private PartyStatusViewInterface status;
	private HuntingViewInterface hunt;
	private RiverGameInterface riverGame;
	
	
	public MainViewFrame() {
		
		try {
		    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
		        if ("Nimbus".equals(info.getName())) {
		            UIManager.setLookAndFeel(info.getClassName());
		            break;
		        }
		    }
		} catch (Exception e) {
		    // If Nimbus is not available, you can set the GUI to another look and feel.
		}
		//UIManager.put("nimbusBase", new Color(81,79,79));
		//UIManager.put("nimbusBlueGrey", new Color(146,15,15));
		//UIManager.put("control", new Color(71,56,40));

		for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels() ){
		    if ("Nimbus".equals(info.getName())) {
		        try {
					UIManager.setLookAndFeel(info.getClassName());
				} catch (ClassNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (InstantiationException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (UnsupportedLookAndFeelException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
		        break;
		    }
		}
		setSize(new Dimension(700,700));
		ImageIcon image = new ImageIcon("resources\\PitchForkIcon.png");
		setIconImage(image.getImage());
		setResizable(false);
		initialize();
	}
	
	private void initialize() {
		getContentPane().setLayout(new CardLayout(0, 0));
		splash = new SplashView();
		setup = new PartySetupView();
		profession = new ProfessionView();
		shop = new ShopView();
		game = new GameView();
		map = new MapView();
		town = new TownView();
		river = new RiverView();
		wagon = new WagonView();
		status = new PartyStatusView();
		hunt = new HuntingView();
		riverGame = new RiverGameView();
		getContentPane().add((JPanel) splash, "Splash Screen");
		getContentPane().add((JPanel) setup, "Party Setup");
		getContentPane().add((JPanel) profession, "Profession");
		getContentPane().add((JPanel) shop, "Shop");
		getContentPane().add((JPanel) game, "Game");
		getContentPane().add((JPanel) map, "Map");
		getContentPane().add((JPanel) town, "Town");
		getContentPane().add((JPanel) river, "River");
		getContentPane().add((JPanel) wagon, "Wagon");
		getContentPane().add((JPanel) status, "Status");
		getContentPane().add((JPanel) hunt, "Hunt");
		getContentPane().add((JPanel) riverGame, "River Game");

	}
	
	public SplashInterface getSplash() {
		return splash;
	}
	
	public PartySetupInterface getPartySetup() {
		return setup;
	}
	
	public ProfessionInterface getProfessionScreen() {
		return profession;
	}
	
	public ShopViewInterface getShop() {
		return shop;
	}
	
	public GameViewInterface getGameView() {
		return game;
	}
	
	public MapViewInterface getMapView() {
		return map;
	}
	
	public RiverViewInterface getRiverView() {
		return river;
	}
	
	public TownViewInterface getTownView() {
		return town;
	}
	
	public WagonViewInterface getWagonView() {
		return wagon;
	}
	
	public PartyStatusViewInterface getPartyStatusView() {
		return status;
	}
	
	public HuntingViewInterface getHuntingView() {
		return hunt;
	}
	
	public RiverGameInterface getRiverGameView() {
		return riverGame;
	}
}
